////////////////////////////////////////////////////////////////////////////////
//                                                                            //
//                           BailterRay                                       //
//                    Pip Robbins & Zhao Zhang                                //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////
class BailterRayNoDodgeVolume extends PhysicsVolume
    placeable;

var() class<DamageType> KillZDamageType;

event ActorEnteredVolume(Actor Other)
{
	if (!Other.bStatic)
	{
		DisableDodge(Other);
	}
}

event PawnEnteredVolume(Pawn Other)
{
	DisableDodge(Other);
}

event ActorLeavingVolume(Actor Other)
{
	if (!Other.bStatic)
	{
		EnableDodge(Other);
	}
}

event PawnLeavingVolume(Pawn Other)
{
	EnableDodge(Other);
}

simulated event Touch( Actor Other, PrimitiveComponent OtherComp, vector HitLocation, vector HitNormal )
{
	if (!Other.bStatic)
	{
		DisableDodge(Other);
	}
}

simulated event DisableDodge(Actor Other)
{

    local BailterRayPawn P;
    local BailterRayPlayerController PC;

	P = BailterRayPawn(Other);
	if(!P.IsHumanControlled())
	{
		return;
	}
    PC = BailterRayPlayerController(P.Controller);
    PC.bEnableDodging = false;

}

simulated event EnableDodge(Actor Other)
{

    local BailterRayPawn P;
    local BailterRayPlayerController PC;

	P = BailterRayPawn(Other);
	if(!P.IsHumanControlled())
	{
		return;
	}
    PC = BailterRayPlayerController(P.Controller);
    PC.bEnableDodging = true;

}

defaultproperties
{
   Begin Object Name=BrushComponent0 ObjName=BrushComponent0 Archetype=BrushComponent'Engine.Default__PhysicsVolume:BrushComponent0'
      ObjectArchetype=BrushComponent'Engine.Default__PhysicsVolume:BrushComponent0'
   End Object
   BrushComponent=BrushComponent0
   Components(0)=BrushComponent0
   CollisionComponent=BrushComponent0
   CollisionType=COLLIDE_CustomDefault
   Name="Default__BailterRayNoDodgeVolumeVolume"
   ObjectArchetype=PhysicsVolume'Engine.Default__PhysicsVolume'
}